package data;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class TermSet
{
	public TermSet()
	{
		frequencies = new HashMap<String,Double>();
	}
	public void addTerm(String term)
	{
		if(frequencies.containsKey(term))
		{
			frequencies.put(term, frequencies.get(term)+1.0);
		}
		else
		{
			frequencies.put(term, 1.0);
		}
	}
	
	public Map<String,Double> getTermFrequencies()
	{
		return frequencies;
	}
	
	public Set<String> getTerms()
	{
		return frequencies.keySet();
	}

	private HashMap<String,Double> frequencies;
}
